|
|
| Menu location |
|---|
| Surface → Filling... |
| Workbenches |
| Surface |
| Default shortcut |
| None |
| Introduced in version |
| - |
| See also |
| None |
Surface Filling creates a surface from a series of connected boundary edges. The curvature of the surface can be additionally controlled by non-boundary edges and vertices, and a support surface.
The base geometry can belong to curves created with the Draft Workbench or the Sketcher Workbench, but can also belong to solid objects such as those created with the Part Workbench or the PartDesign Workbench.
Two filled surfaces delimited by four edges located on the XY plane. The surface on the right is additionally controlled by a non-boundary edge.
The Support surface acts as an additional constraint for the surface. The following simple example will give you an idea how this works:
180°.
A Surface Filling (Surface::Filling class) is derived from the basic Part Feature (Part::Feature class, through the Part::Spline subclass), therefore it shares all the latter's properties.
In addition to the properties described in Part Feature, the Surface Filling has the following properties in the property editor.
Filling
Base
Bool): it defaults to false; if set to true, it will show an overlay with the control points of the surface.See also: FreeCAD Scripting Basics.
The Surface Filling tool can be used in macros and from the Python console by adding the Surface::Filling object.
BoundaryEdges property of the object.UnboundEdges and Points properties of the object.import FreeCAD as App
import Draft
doc = App.newDocument()
a = App.Vector(-20, -20, 0)
b = App.Vector(-18, 25, 0)
c = App.Vector(60, 26, 0)
d = App.Vector(33, -20, 0)
points1 = [a, App.Vector(-20, -8, 0), App.Vector(-17, 7, 0), b]
obj1 = Draft.make_bspline(points1)
points2 = [b, App.Vector(0, 25, 0), c]
obj2 = Draft.make_bspline(points2)
points3 = [c, App.Vector(37, 4, 0), d]
obj3 = Draft.make_bspline(points3)
points4 = [d, App.Vector(-2, -18, 0), a]
obj4 = Draft.make_bspline(points4)
doc.recompute()
surf = doc.addObject("Surface::Filling", "Surface")
surf.BoundaryEdges = [(obj1, "Edge1"),
(obj2, "Edge1"),
(obj3, "Edge1"),
(obj4, "Edge1")]
doc.recompute()
# ---------------------------------------------------------
points_spl = [App.Vector(-10, 0, 2),
App.Vector(4, 0, 7),
App.Vector(18, 0, -5),
App.Vector(25, 0, 0),
App.Vector(30, 0, 0)]
aux_edge = Draft.make_bspline(points_spl)
doc.recompute()
surf.UnboundEdges = [(aux_edge, "Edge1")]
doc.recompute()
# ---------------------------------------------------------
aux_v1 = Draft.make_line(App.Vector(-13, -12, 5),
App.Vector(-13, -12, -5))
aux_v2 = Draft.make_line(App.Vector(-3, 18, 5),
App.Vector(-3, 18, -5))
doc.recompute()
surf.Points = [(aux_v1, "Vertex2"),
(aux_v2, "Vertex1")]
doc.recompute()